<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title></title>
		<style>
            /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
            ::-webkit-scrollbar{
              width: 5px;
              height: 5px;
              background-color: #F5F5F5;
            }
            
            /*定义滚动条轨道 内阴影+圆角*/
            ::-webkit-scrollbar-track {
              box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
              -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
              border-radius: 10px;
              background-color: #F5F5F5;
            }
            
            /*定义滑块 内阴影+圆角*/
            ::-webkit-scrollbar-thumb{
              border-radius: 10px;
              box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
              -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .1);
              /*滚动条的颜色*/
              background-color: #00BFFF;
            }

			*{
				margin:0;
				padding:0;
			}
			body{
				font-family:"微软雅黑";
				background-color:#ddd;
			}
			.module_panel {
				height: 100%;
				width: 100%;
				min-width: 100%;
				display: flex;
				flex-wrap: wrap;
			}
			
			.module_panel div {
				display: flex;
				justify-content: flex-end;
				align-items: center;
				flex-direction: column;
				margin: 5px;
			}
			.module_panel div img {
				width: 50px;
				height: 50px;
			}
			
		</style>
		<!--layui框架-->
		<link rel="stylesheet" href="js/plugIn/layui-master/src/css/layui.css">
		<script src="js/plugIn/jquery/jquery.min.js"></script><!--jquery 要在layui之前，这样layui就不会加载内部的jquery-->
		<script src="js/plugIn/layui-master/src/layui.js"></script>
		<script src="js/common/tool.js"></script>
		<script src="config/InitConfig.js"></script>
	</head>
	<body>
		<div class="layui-tab layui-tab-card"  lay-filter="zt_attr_tab" style="border-width: 0px;margin:0px">
			<ul class="layui-tab-title">
				<li class="layui-this">内置开关</li>
				<li>我的图库</li>
			</ul>
			<div class="layui-tab-content" >
				<div class="layui-tab-item layui-show">
					<div class="module_panel" id="listSwitch">
						<!-- 图片内容 -->
		
					</div>
				</div>
		
				<div class="layui-tab-item" >
		
					<div class="module_panel" id="myListImage">
						<!-- 我的图库 -->
		
					</div>
		
				</div>
		
		
		
			</div>
		</div>
	</body>
<script>
    //初始化（我的图库）
	var baseURL = localStorage.getItem("baseURL");
    layui.use(['element'], function(){
    	var userId = ""; //用于查询我的组件
    	var initjson;
    
    	userId = $_GET.userId;
    	var initConfig = new InitConfig();
    	//读取配置文件
    	$.ajaxSettings.async = false; //设置getJson同步
    	$.getJSON("config/init.json", function (data){
    		initjson=data;
    	});
    
    	$.ajaxSettings.async = true;//设置getJson异步
    
      
    	var module_base = eval("initConfig."+initjson.initMyMoudleFunction+"()");
    
    
    	var myList = "";
    	for (var z=0;z<module_base.length;z++){
    		var imageurl = baseURL + module_base[z].file_path;
    		myList+='<div>';
    		myList+='<img style="cursor:pointer" onclick=selectSwitch(\"'+imageurl+'\") src='+imageurl+' alt=""/>';
    		myList+='</div>';
    
    	}
    	$("#myListImage").html(myList);
    });
	//内置开关图片
	var index = parent.layer.getFrameIndex(window.name);
	var switchList = [
	'config/switch/1_0.svg',
	'config/switch/1_1.svg',
	'config/switch/2_0.svg',
	'config/switch/2_1.svg',
	
	'config/switch/3_0.svg',
	'config/switch/3_1.svg',
	'config/switch/4_0.svg',
	'config/switch/4_1.svg',
	
	'config/switch/5_0.svg',
	'config/switch/5_1.svg',
	'config/switch/7_0.svg',
	'config/switch/7_1.svg',
	
	'config/switch/6_0.svg',
	'config/switch/6_1.svg',
	// 'config/switch/9_0.svg',
	// 'config/switch/9_1.svg',
	
	'config/switch/11_0.svg',
	'config/switch/11_1.svg',
	'config/switch/12_0.svg',
	'config/switch/12_1.svg',
	
	'config/switch/13_0.svg',
	'config/switch/13_1.svg',
	'config/switch/14_0.svg',
	'config/switch/14_1.svg',
	
	'config/switch/15_0.svg',
	'config/switch/15_1.svg',
	'config/switch/16_0.svg',
	'config/switch/16_1.svg',
	
	'config/switch/17_0.svg',
	'config/switch/17_1.svg',
	'config/switch/18_0.svg',
	'config/switch/18_1.svg'
];
var liList = "";
for (var i=0;i<switchList.length;i++){
	liList+="<li style='display:inline-block;height:70px;line-height:70px;margin:6px;'><img onclick=selectSwitch(\'"+switchList[i]+"\') src='"+switchList[i]+"' style='vertical-align:middle;max-width: 60px;max-height:70px;cursor:pointer' /></li>";
}
$("#listSwitch").html(liList);
function selectSwitch(iconUrl){
		parent.switchIconUrl=iconUrl;
		parent.layer.close(index);


}

</script>
</html>
